<template>
    <div class="map_container">
        <map-route :route-info="routeInfo"></map-route>
    </div>
</template>

<script>

let plugin = requirePlugin("mapPlugin");

export default {
    data() {
        return {
            routeInfo: {}
        };
    },
    onShow() {
        let mapInfo = {
            startLat: 121.6695,
            startLng: 31.268726,
            endLat: 31.264907491401107,
            endLng: 121.51072952012122,
            endName: "上海市上海市杨浦区兰州路周家嘴路1333弄"
        };
        let routeInfo = {
            startLat: mapInfo.startLat, //起点纬度 选填
            startLng: mapInfo.startLng, //起点经度 选填
            startName: "我的位置", // 起点名称 选填
            endLat: mapInfo.endLat, // 终点纬度必传
            endLng: mapInfo.endLng, //终点经度 必传
            endName: mapInfo.endName || "", //终点名称 必传
            mode: "car" //算路方式 选填
        };
        this.routeInfo = routeInfo;
    }
};
</script>

<style>
.map_container {
    width: 100%;
    height: 100%;
}

.map {
    height: 100%;
    width: 100%;
}
</style>
